package com.ddd.infrastructure.durable.codebooks;

import java.util.ArrayList;
import java.util.List;

// 全局公用  码表
public class PublicCode {
    /***PV险种*/
    public static final List<String> PVTYPES = new ArrayList<String>() {{
        add("E1000");
        add("E1001");
        add("E1002");
        add("F1200");
        add("F1201");
        add("F1202");
    }};

    /***经度方位*/
    public enum LongitudePositionEnum {
        ZERO("0", "东京"),
        ONE("1", "西京");
        private String status;
        private String describe;

        private LongitudePositionEnum(String status, String describe) {
            this.status = status;
            this.describe = describe;
        }

        public String getStatus() {
            return status;
        }

        public String getDescribe() {
            return describe;
        }


        //通过status 找对应的describe
        public static String getDescribe(String status){
            for (LongitudePositionEnum value : LongitudePositionEnum.values()) {
                if (status.equals(value.getStatus())) {
                    return  value.getDescribe();
                }
            }
            return "NULL";
        }
        //通过describe找对应的status
        public static String getStatus(String describe){
            for (LongitudePositionEnum value : LongitudePositionEnum.values()) {
                if (describe.equals(value.getDescribe())) {
                    return  value.getStatus();
                }
            }
            return "NULL";
        }

    }

}
